<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h1><h:outputText value="Edit Vacancy"/></h1>
                <h:panelGrid columns="2">
                    <h:outputLabel value="VacancyID" for="vacancyID" />
                    <h:inputText id="vacancyID" value="#{vmb.vac.vacancyID}" disabled="true"/>
                    <h:outputLabel value="Title" for="title" />
                    <h:inputText id="title" value="#{vmb.vac.title}" required="true" requiredMessage="You must enter title"/>                  

                    <h:outputLabel value="Status" for="status" />
                    <h:inputText id="status" value="#{vmb.vac.status}" required="true" requiredMessage="You must enter status" />
                    <h:outputLabel value="NumberRequirement" for="numberRequirement" />
                    <h:inputText id="numberRequirement" value="#{vmb.vac.numberRequirement}" required="true" requiredMessage="You must enter numberRequirement" />
                    <h:outputLabel value="Position" for="position" />
                    <h:inputText id="position" value="#{vmb.vac.position}" required="true" requiredMessage="You must enter numberRequirement" />
                    <h:outputLabel value="WorkingPlace" for="workingPlace" />
                    <h:inputText id="workingPlace" value="#{vmb.vac.workingPlace}" required="true" requiredMessage="You must enter workingPlace" />
                    <h:outputLabel value="WorkType" for="workType" />
                    <h:inputText id="workType" value="#{vmb.vac.workType}" required="true" requiredMessage="You must enter workType" />
                    <h:outputLabel value="MinimumSalary" for="minimumSalary" />
                    <h:inputText id="minimumSalary" value="#{vmb.vac.minimumSalary}" required="true" requiredMessage="You must enter minimumSalary" />
                    <h:outputLabel value="MaximumSalary" for="maximumSalary" />
                    <h:inputText id="maximumSalary" value="#{vmb.vac.maximumSalary}" required="true" requiredMessage="You must enter maximumSalary" />
                    <h:outputLabel value="Description" for="description" />
                    <h:inputTextarea id="description" value="#{vmb.vac.description}" style="width: 500px; height: 100px" />
                    <h:outputLabel value="SkillRequirement" for="skillRequirement" />
                    <h:inputTextarea id="skillRequirement" value="#{vmb.vac.skillRequirement}" style="width: 500px; height: 100px"/>
                    <h:outputLabel value="Entitlement" for="entitlement" />
                    <h:inputTextarea id="entitlement" value="#{vmb.vac.entitlement}" style="width: 500px; height: 100px"/>
                    <h:outputLabel value="MinimumAge" for="minimumAge" />
                    <h:selectOneMenu id="minimumAge"
                                     value="#{vmb.vac.minimumAge}"
                                     styleClass="text-input medium-input">
                        <f:selectItem itemLabel="18" itemValue="18"/>
                        <f:selectItem itemLabel="20" itemValue="20" />
                        <f:selectItem itemLabel="22" itemValue="22" />
                        <f:selectItem itemLabel="24" itemValue="24" />
                    </h:selectOneMenu>
                    <h:outputLabel value="MaximumAge" for="maximumAge" />
                    <h:selectOneMenu id="maximumAge"
                                     value="#{vmb.vac.maximumAge}"
                                     styleClass="text-input medium-input">
                        <f:selectItem itemLabel="30" itemValue="30"/>
                        <f:selectItem itemLabel="35" itemValue="35" />
                        <f:selectItem itemLabel="38" itemValue="38" />
                        <f:selectItem itemLabel="40" itemValue="40" />
                    </h:selectOneMenu>
                    <h:outputLabel value="Gender" for="gender" />
                    <h:selectOneMenu id="gender"
                                     value="#{vmb.vac.gender}"
                                     styleClass="text-input medium-input">
                        <f:selectItem itemLabel="Male" itemValue="#{true}"/>
                        <f:selectItem itemLabel="Female" itemValue="#{false}" />
                    </h:selectOneMenu>
                    <h:outputLabel value="Degree}" for="degree" />
                    <h:inputText id="degree" value="#{vmb.vac.degree}" required="true" requiredMessage="You must enter degree" />
                    <h:outputLabel value="YearOfExperience" for="yearOfExperience" />
                    <h:inputText id="yearOfExperience" value="#{vmb.vac.yearOfExperience}" required="true" requiredMessage="You must enter yearOfExperience" />
                    <h:outputLabel value="ProbationaryPeriod" for="probationaryPeriod" />
                    <h:inputText id="probationaryPeriod" value="#{vmb.vac.probationaryPeriod}" required="true" requiredMessage="You must enter probationaryPeriod" />
                    <h:outputLabel value="Deadline" for="deadline" />
                    <h:inputText id="deadline" value="#{vmb.vac.deadline}" required="true" requiredMessage="You must enter workType" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="DepartmentID" for="departmentID" />
                    <h:selectOneMenu id="employeeID" value="#{vmb.departmentID}">
                        <f:selectItems var="d" value="#{dmb.depList()}" itemLabel="#{d.name}" itemValue="#{d.departmentID}"></f:selectItems>                        
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandButton action="#{vmb.editvac()}" value="Update"/>
                <br />
                <h:commandButton action="List" value="Back" />
                <br />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
